home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12271 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Determining the length of an int in string form
  5. Date: 29 Mar 1996 21:37:25 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4jia9l$81e@solutions.solon.com>
  8. References: <3156D7BD.90D@oc.com> <828141352snz@genesis.demon.co.uk>
  9. NNTP-Posting-Host: solutions.solon.com
  10.  
  11. In article <828141352snz@genesis.demon.co.uk>,
  12. Lawrence Kirby  <fred@genesis.demon.co.uk> wrote:
  13. [re:]
  14. >>Do implementations of snprintf() exist today that could be held up
  15. >>as prior-art?
  16.  
  17. >I don't know of any offhand.
  18.  
  19. BSD 4.4 or so (maybe later, it's NetBSD) has snprintf and vsnprintf.
  20. There are *not* fnprintf/nprintf.  Their semantics are that they write
  21. at most (size - 1) bytes into the given buffer, and NUL terminate it.
  22. If the return value is >= the size argument, the string was too short,
  23. "and some of the printed characters were discarded".  It is not specified
  24. that it tells you how short you were.
  25.  
  26. Arguably, not part of C, but discussions of possible future standardization
  27. are vaguely topical.
  28.  
  29. It's a great feature, and I'd use it heavily if it were part of the
  30. language.
  31.  
  32. -s
  33. -- 
  34. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  35. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  36. FUCK the communications decency act.  Goddamned government.  [literally.]
  37. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  38.